package leetcode.bitoperation;

public class TwoOdd {
    public static void process(int[] arr){
        int m = 0;
        int rightOne = 0;
        int m1 = 0;
        for (int n:arr) {
            m=m^n;
        }
        rightOne = m & (~m+1);//0011010取反得1100101 1100101+1=1100110 1100110^0011010=0000010 取得右侧第一个1
        for (int i = 0; i < arr.length; i++) {
            if ((rightOne & arr[i]) ==0){
                m1 = m1^arr[i];
            }
        }
        System.out.println(m1);
        System.out.println(m1^m);
    }
}
